#include "MyTrajectory.h"

void MyTrajectory::CsvParser(vector<vector<dReal>>& waypoints)
{
	ifstream csvfile(_tname);
	string content = "";
	if(csvfile)
	{
		std::stringstream buffer;   
		buffer << csvfile.rdbuf();   
		content = buffer.str();
	}
	csvfile.close();

	istringstream is(content);
	
	while (true)
	{
		vector<dReal> rec = CsvGetLine(is);
		if (rec.size() == 0) 
			break;
		waypoints.push_back(rec);
	}
}